function haa(e) {
    return function(e) {
        try {
            return btoa(e)
        } catch (t) {
            return Buffer.from(e).toString("base64")
        }
    }(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g, (function(e, t) {
            return i("0x" + t)
        }
    )))
}

function g(e, t) {
    t || (t = s());
    for (var a = (e = e.split("")).length, n = t.length, o = "charCodeAt", r = 0; r < a; r++)
        e[r] = i(e[r][o](0) ^ t[(r + 10) % n][o](0));
    return e.join("")
}
function i(e) {
    var t, a = (t = "",
        ["66", "72", "6f", "6d", "43", "68", "61", "72", "43", "6f", "64", "65"].forEach((function(e) {
                t += unescape("%u00" + e)
            }
        )),
        t);
    return String[a](e)
}


var l = "00000008d78d46a";
var ac, t,f = 30148;
var h="analysis";

function en(cdd){
    var e = JSON.parse(cdd);
    try{
        var a, o = (+new Date - (f | 0) - 1515125653845), r = [];
        Object.keys(e.params).forEach((function(t) {
                if (t == h)
                    return !1;
                e.params.hasOwnProperty(t) && r.push(e.params[t])
            }
        )),
            r = r.sort().join(""),
            r = haa(r),
            r += "@#" + e.url.replace(e.baseURL, ""),
            r += "@#" + o,
            r += "@#" + 1,
            a = haa(g(r,l)),
            ac =  encodeURIComponent(a);
        return ac;
    }catch(e){
    }
}
console.log(en("{\"baseUrl\":\"https://api.qimai.cn\",\"params\":{\"country\":\"cn\",\"sword\":\"\",\"sdate\":\"2021-09-13 00:00:00\",\"appid\":\"1570277888\",\"edate\":\"2021-09-13 23:59:59\"},\"url\":\"/app/comment\"}"))
